﻿<!DOCTYPE html> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"/> 
<title>小票打印</title>
<style type="text/css">
*{padding:0;margin: 0;}
h1{font-size: 20px;}
h3{font-size: 16px;}
.left{
    float: left;
}
.right{
    float:right;
}
.clearfix{
    clear: both;
}
ul{list-style: none;}
.print_container{
    padding: 0px;
    width: 188px;
    margin: 0 auto;
}
.section1{
}
.section2 label{
    display: block;
}
.section3 label{
    display: block;
}
.section4{
}
.section4 .total label{
    display: block;
}
.section4 .other_fee{
    border-bottom: 1px solid #DADADA;
}
.section5 label{
    display: block;
}


</style>
<style media="print">

@page {
            size: auto;  /* auto is the initial value */
            margin: 1mm; /* this affects the margin in the printer settings */
        }
</style>
<script type="text/javascript">   
  function doPrint() {   
    bdhtml=window.document.body.innerHTML;   
    sprnstr="<!--startprint-->";   
    eprnstr="<!--endprint-->";   
    prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);   
    prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));   
    window.document.body.innerHTML=prnhtml;  
    window.print();   
}   
</script> 
</head> 
  
<body> 

<!--startprint--><!--注意要加上html里star和end的这两个标记--> 
<div class="print_container">
            <h1>给顾客专用</h1>
            <span>**************************</span>
            <div class="section1">
                <h3>广积德发药单</h3>
            </div>
            <span>**************************</span>
           
            <div class="section3">
                <label>订单编号：{$order.order_sn}</label>
                <label>下单时间：{$order.add_time|date='Y-m-d H:i:s',###}</label>
            </div>
            <span>**************************</span>
            <div class="section4">
                <div style="border-bottom: 1px solid #DADADA;">
                    <!--<ul>
                        <div>菜单名称     数量    金额</div>
                        <li>米饭米饭 米饭 米饭 米饭 米饭 米饭       2    28元</li>
                        <li>米饭      2    28元</li>
                    </ul>-->
                    <table style="width: 100%;">
                        <thead>
                            <tr>
                                <td width="60%">商品名称</td>
                                
                                <td width="40%">金额</td>
                            </tr>
                        </thead>
                        <tbody>
                            <volist name="orderGoods" id="good">
                                <tr>
                                    <td>{$good.goods_name}</td>
                                    <td class="text-right">{$good.goods_total}</td>
                                </tr>
                            </volist>
                          
                            
                        </tbody>
                    </table>
                </div>
                <div class="total">
                    <label class="left">总计</label>
                    <label class="right">{$order.total_amount}</label>
                <div class="clearfix"></div>
                </div>
                <div style="text-align: right;">
                    <label>顾客已付款</label>
                </div>
                <div class="canh">
                        <label class="left">发货状态</label>
                        <label class="right"><if condition="$order['shipping_status'] eq '0'">未发<elseif condition="$order['shipping_status'] eq '1'"/>自提<else/> 物流配送</if></label>
                        <div class="clearfix"></div>
                </div>
                <span>**************************</span>
            </div>
            <div class="section5">
                <label>姓名：{$order.consignee}</label>
                <label>电话：{$order.mobile}</label>
            </div>    
            <span>**************************</span>
        </div>
<!--endprint--> 
<button type="button" style='margin: 0 auto;width: 50px;display: block;' onclick="doPrint()">打印</button> 

</body> 
</html> 

